<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./layui-v2.6.8/layui/css/layui.css">
    <!-- 别人写的 -->
    <style>
        .bg1 {
            background-color: red;
        }

        .bg2 {
            background-color: blue;
        }

        .bg3 {
            background-color: yellowgreen;
        }
    </style>
    <!-- 自己写的样式 -->
    <style>
        div {
            width: 300px;
            height: 200px;
            background-color: olive;
            margin-bottom: 20px;
        }
    </style>
</head>

<body>
    <!-- UI框架 
    原生----自己编写
    layui---学习使用别人写好的代码;
    -->

    <!-- 根据类名,调用不同的样式 -->
    <!-- <div class="box1 bg1">1</div>
    <div class="box2 bg3">2</div>
    <div class="box3 bg2">3</div> -->

    <div class="box1 layui-bg-red layui-anim" id="btn1">1</div>
    <div class="box2 layui-bg-orange layui-anim layui-anim-down">2</div>
    <div class="box3 layui-bg-blue">3</div>
    <script>
        document.getElementById('btn1').onclick = function () {
            this.className = 'box1 layui-bg-red layui-anim layui-anim-down'
        }
    </script>
</body>

</html>